package com.example.calculator;


import android.graphics.Canvas;
import android.graphics.RadialGradient;
import android.graphics.Shader;
import android.os.Bundle;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.View.OnTouchListener;
import android.widget.Button;
import android.app.Activity;


public class MyActivity extends Activity {

    private Button btnchange;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_third);

        btnchange = (Button) findViewById(R.id.btnchange);


        btnchange.setOnTouchListener(new OnTouchListener() {

            public boolean onTouch(View v, MotionEvent event) {
                if(event.getAction() == MotionEvent.ACTION_DOWN){
                    btnchange.setBackgroundResource(R.drawable.btnon);
                }else if(event.getAction() == MotionEvent.ACTION_UP){
                    btnchange.setBackgroundResource(R.drawable.btnoff);

                }
                return false;
            }
        });
    }


}